package com.createdevelopment.gaoyou;

import com.createdevelopment.gaoyou.adapter.ImageAdapter;

import android.os.Bundle;
import android.annotation.SuppressLint;
import android.app.ActionBar;
import android.app.Activity;
import android.app.ActionBar.LayoutParams;
import android.content.Intent;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.View;
import android.widget.AdapterView;
import android.widget.GridView;
import android.widget.AdapterView.OnItemClickListener;

@SuppressLint("NewApi")
public class CityCardActivity extends Activity {
    
	private Integer[] mThumbIds = { R.drawable.citycard_1,
			R.drawable.citycard_2, R.drawable.citycard_7,
			R.drawable.citycard_3, R.drawable.citycard_8,
			R.drawable.citycard_4,R.drawable.citycard_9,
			R.drawable.citycard_5,R.drawable.citycard_10,
			R.drawable.citycard_6

	};
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_city_card);
		ActionBar bar = this.getActionBar();

		GridView gridview = (GridView) findViewById(R.id.city_card);
		ImageAdapter imageAdapter = new ImageAdapter(this);
		imageAdapter.setmThumbIds(mThumbIds);
		gridview.setAdapter(imageAdapter);

		gridview.setOnItemClickListener(new OnItemClickListener() {
			public void onItemClick(AdapterView<?> parent, View v,
					int position, long id) {
				
			}
		});

	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.city_card, menu);
		ActionBar actionBar=this.getActionBar();       
        ActionBar.LayoutParams params=new ActionBar.LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT,Gravity.CENTER );
        View view=LayoutInflater.from(this).inflate(R.layout.actionbar_view, null); 
        view.setBackgroundResource(R.drawable.investment_area_header_bg);
        actionBar.setCustomView(view,params);
        actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
        actionBar.setDisplayShowCustomEnabled(true);

		return true;
	}

}
